<template>
    <div id="slideMid" v-show="this.$store.state.isSlide">
    	<!-- 左边侧边栏中间路由内容区域 -->
         <ul class="link-list center-block">
          <router-link v-for="(item,index) in list" 
     :key="item.value" :to="{path:item.path,query:{item:index}}"
     :class="{'router-link-exact-active':ind == index , 'hide': index == 4 && isShow}"
      @click.native="changeBgc(index)" tag="li"> 
      {{item.label}} 
    </router-link>
       
      </ul>
    </div>
</template>
<script>
export default {
    data : function(){
      return{
        list: [
          { path: '/inpatients', label: '在科患者' },
          { path: '/inpatientsAll', label: '所有患者' },
          { path: '/collection', label: '我的收藏' },
          { path: '/diseasestatistics', label: '病情统计' },
          { path: '/qualityControl', label: '重症质控' },
          { path: '/patientShiftLog', label: '交班日志' },
          // { path:'/registeredUser', label:'来访医生'},
          { path:'/changepassword',label:''}
      ],
      ind: '0'
      }
     
    },
    computed:  {
      isShow:function() {
        if (sessionStorage.getItem('loginType') == 1) {
          return true;
        } else {
          return false;
        }
      }
    },
    methods : {
       changeBgc(index){
         this.ind = index;
         if (index == 0) {
           this.$router.push({
             name: "inpatients",
             query: { item: 0, department: 1 }
           });
         } else if (index == 3) {
           this.$router.push({
             name: "diseasestatistics",
             query: { item: 3, department: 1 }
           });
         } else if (index == 5) {
           this.$router.push({
             path: "/patientShiftLog",
             query: { item: 5, department: 1 }
           });
         }
    },
    
         },
    mounted(){
    if(this.$route.query.item){
    this.ind = this.$route.query.ite;
    }else{
      this.ind = 0;
    }
  }
    }

</script>
<style scoped>
#slideMid{
  padding-top: 50px!important;
}
.link-list li {
  line-height: 7vh;
  height: 7vh;
  cursor: pointer;
  text-align:center;
}
  .link-list li.router-link-exact-active, .link-list li.router-link-active {
    background-color: #11a7f3;
  }
.link-list li:last-child.router-link-exact-active{
   background-color:#f7f7f7;
}
.link-list li:last-child.router-link-exact-active:before{
  background-image:url('../../../../static/images/changePassword_1.png');
}
.link-list li{
  display:block;
  width:100%;
  color:#666;
}
.link-list li:last-child{
   position:absolute;
   bottom:38px;
   cursor:pointer;
   max-width:254px;
}
.link-list li:last-child:before{
       display:inline-block;
       content:'';
       width:30px;
       height:30px;
       background-image:url('../../../../static/images/changePassword.png');
       margin-top:20px;
}
  .link-list li.router-link-exact-active, .link-list li.router-link-active {
    color: #FFF;
  }
</style>

